﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using ShowMeTellMeData;

public partial class Projects_SeMeHearMe : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!Page.IsPostBack)
    {
      LblQuestion.Text = StoredProcedures.GetRandomQuestion().Rows[0]["Question_Text"].ToString();
    }
  }

  protected void BtnNextQuestion_Click(object sender, EventArgs e)
  {
    LblQuestion.Text = StoredProcedures.GetRandomQuestion().Rows[0]["Question_Text"].ToString();
    LblAnswer.Text = null;
    BtnShowAnswer.Enabled = true;
  }

  protected void BtnShowAnswer_Click(object sender, EventArgs e)
  {
    LblAnswer.Text = StoredProcedures.GetAnswer(LblQuestion.Text).Rows[0]["Answer_Text"].ToString();
    BtnShowAnswer.Enabled = false;
  }

  protected void BtnShowSolution_Click(object sender, EventArgs e)
  {
    ObjectivePanel.Visible = false;
    SolutionPanel.Visible = true;
  }

  protected void BtnShowObjective_Click(object sender, EventArgs e)
  {
    ObjectivePanel.Visible = true;
    SolutionPanel.Visible = false;
  }

}